package top.mhtools.pigeon.wechat.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import top.mhtools.pigeon.common.enums.SendTypeEnum;
import top.mhtools.pigeon.common.persistence.SendMessageRequest;
import top.mhtools.pigeon.ding.dto.DingMessageReqDTO;

import java.util.Map;

/**
 * 企业微信消息入参实体
 *
 * @author machen
 * @date 2020/6/11 17:46
 */
@Data
public class WeChatMessageReqDTO extends BaseWeChatMessageDTO implements SendMessageRequest {

    @ApiModelProperty(value = "markdown消息入参")
    private WeChatMessageReqDTO.Markdown markdown;

    @Data
    public static class Markdown {
        @ApiModelProperty(value = "markdown格式的消息")
        private String content;

        @ApiModelProperty(value = "搭配模板使用")
        private Map<String, Object> textMap;
    }


    @Override
    public String getSendType() {
        return SendTypeEnum.WE_CHAT.getName();
    }

    @Override
    public DingMessageReqDTO getDingMessageReqDTO() {
        return null;
    }

    @Override
    public WeChatMessageReqDTO getWeChatMessageReqDTO() {
        return this;
    }
}
